package com.quicklife.service.impl;

import java.util.List;

import net.sf.json.JSONObject;

import com.quicklife.pojo.Coupons;
import com.quicklife.service.inter.WebCouponStatisticService;
import com.quicklife.util.JsonUtil;
import com.quicklife.util.SqlHelper;
import com.quicklife.util.StringUtil;

/**
 * web优惠统计分析
 * 
 * @author HackerD
 * 
 */
public class WebCouponStatisticServiceImpl implements WebCouponStatisticService {

	@Override
	public String getCouponStatistic(String rqinfso) {
		try {
			String busid = rqinfso;

			String beTwo = "select uses+10 uses,name from coupons where status=1 and busid=?";
			List list = SqlHelper.executeQuery(beTwo, new String[] { busid },
					null);

			return JsonUtil.createRtJsonStr(StringUtil.RESULT_CODE_OK, list);
		} catch (Exception e) {
			e.printStackTrace();
			return JsonUtil.createRtJsonStr(StringUtil.RESULT_CODE_FAIL,
					StringUtil.RESULT_EXCEPTION);
		}
	}

}
